package seckill

import (
	"gin_miaosa/zhiliao_web/middle_ware"

	"github.com/gin-gonic/gin"
)

func Router(router *gin.RouterGroup)  {

	// 管理端、
	router.GET("/get_seckill_list",middle_ware.JwtTokenValid,GetSeckillList)
	router.GET("/get_products",middle_ware.JwtTokenValid,GetProducts)
	router.POST("/seckill_add",middle_ware.JwtTokenValid,SecKillAdd)
	router.POST("/seckill_del",middle_ware.JwtTokenValid,SecKillDel)
	router.GET("/seckill_to_edit",middle_ware.JwtTokenValid,SeckillToEdit)
	router.POST("/seckill_do_edit",middle_ware.JwtTokenValid,ProductDoEdit)
	// 前端列表
	router.GET("/front/get_seckill_list",GetFrontSeckillList)
	// 前端详情
	router.GET("/front/seckill_detail",middle_ware.JwtTokenFrontValid,SecKillDetail)
	// 秒杀接口
	// router.POST("/front/seckill",middle_ware.JwtTokenFrontValid,SecKill)
	// 获取下单结果
	// router.GET("/front/get_seckill_result",middle_ware.JwtTokenFrontValid,GetSeckillResult)


	// // 、、、、、、、、、、、、/buxuyao token
	// // curl -X GET http://localhost:8081/seckill/get_seckill_list
	// router.GET("/get_seckill_list",GetSeckillList)
	// // curl -X GET http://localhost:8081/seckill/get_products
	// router.GET("/get_products",GetProducts)
	// //curl -X POST -d "name=apple&price=5&num=10&pid=1&start_time=2023-08-30 00:00:00&end_time=2023-08-31 00:00:00" http://localhost:8081/seckill/seckill_add
	// router.POST("/seckill_add",SecKillAdd)
	// // curl -X POST -d "id=2" http://localhost:8081/seckill/seckill_del
	// router.POST("/seckill_del",SecKillDel)
	// // curl -X GET http://localhost:8081/seckill/seckill_to_edit?id=3
	// router.GET("/seckill_to_edit",SeckillToEdit)
	// router.POST("/seckill_do_edit",ProductDoEdit)


	// // 前端列表  curl -X GET http://localhost:8081/seckill/front/get_seckill_list
	// router.GET("/front/get_seckill_list",GetFrontSeckillList)
	// // 前端详情  curl -X GET http://localhost:8081/seckill/front/seckill_detail?id=3
	// router.GET("/front/seckill_detail",SecKillDetail)
	// // 秒杀接口  curl -X POST -d "id=2" http://localhost:8081/seckill/front/seckill
	router.POST("/front/seckill",SecKill)
	// // 秒杀接口  curl -X POST -d "id=2" http://localhost:8081/seckill/front/seckill_rpc
	router.POST("/front/seckill_rpc",SecKill_rpc)
	// // 获取下单结果  curl -X GET http://localhost:8081/seckill/front/get_seckill_result?front_user_name=3
	router.POST("/front/get_seckill_result",GetSeckillResult)
	router.POST("/front/pay",Pay)


}




